package org.example.index;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.SysNotice;
import org.example.contract.domain.Contract;
import org.example.statistics.domain.StatisticsMonthMoney;
import org.example.statistics.service.IStatisticsCurrMonthMoneyService;
import org.example.statistics.service.IStatisticsMonthMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/index")
public class CaoXiaoIndexController extends BaseController {


    @Autowired
    private IStatisticsMonthMoneyService statisticsMonthMoneyService;

    @Autowired
    private IStatisticsCurrMonthMoneyService statisticsCurrMonthMoneyService;

    @Autowired
    private IIndexService indexService;

    @PostMapping("/statistics/month")
    @ResponseBody
    public AjaxResult month(StatisticsMonthMoney statisticsMonthMoney)
    {
        return AjaxResult.success();
    }

    @PostMapping("/notice/list")
    @ResponseBody
    public TableDataInfo list(SysNotice notice)
    {
        startPage();
        List<SysNotice> list = indexService.selectNoticeList(notice);
        return getDataTable(list);
    }

    @PostMapping("/dept")
    @ResponseBody
    public AjaxResult dept()
    {
        return AjaxResult.success(indexService.dept(new SysDept()));
    }





}
